﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using JWXH.XH.components;
using JWXH.XH.interfaces;
using JWXH.XH.pages;
using JWXH.XH.pages.listview;
using JWXH.XH.pages.map;
using JWXH.XH.pages.mvvm;
using JWXH.XH.pages.tabbedpage;
using JWXH.XH.pages.tableview;
using JWXH.XH.utils;
using Xamarin.Forms;

namespace JWXH.XH
{
    public partial class MainPage : ContentPage
    {
        public MainPage()
        {
            InitializeComponent();
            BindingContext = this;
            //		    App.Current.
            this.ImgLogoicon.WidthRequest = SizeUtils.GetRealPx(120);
            this.ImgLogoicon.HeightRequest = SizeUtils.GetRealPx(120);

            this.AccountPwdGrid.Margin = new Thickness(SizeUtils.GetRealPx(48), SizeUtils.GetRealPx(128), SizeUtils.GetRealPx(48), 0);
            this.AccountPwdLeft.Width = SizeUtils.GetRealPx(32 * 2 + 50);
        }

        private async void ButtonLogin_OnClicked(object sender, EventArgs e)
        {
            await Navigation.PushAsync(new TestPage());
            //            await Navigation.PushModalAsync(new TestPage());
        }

        private async void BtnRelativeLayout_OnClicked(object sender, EventArgs e)
        {
            await Navigation.PushAsync(new RelativeTest());
        }
        private async void BtnTest2_OnClicked(object sender, EventArgs e)
        {
            await Navigation.PushAsync(new TestPage2());
        }

        private void BtnLinearMenu_OnClicked(object sender, EventArgs e)
        {
            Navigation.PushAsync(new TestLinearMenu());
        }

        private void TapbedPage_OnClicked(object sender, EventArgs e)
        {
            Navigation.PushAsync(new TabbedPageTest());
        }

        private void BtnMvvm1_OnClicked(object sender, EventArgs e)
        {
            Navigation.PushAsync(new MvvmTest1());
        }
        private void BtnListView_OnClicked(object sender, EventArgs e)
        {
            Navigation.PushAsync(new ListViewTest1());
        }

        // 改变Entry的颜色
        private void ImgChangeTxtBorder_OnTapped(object sender, EventArgs e)
        {
            this.txtAccount.CusBorderColor = "#F0FF01FF";
        }

        private void BtnTableview_OnClicked(object sender, EventArgs e)
        {
            Navigation.PushAsync(new TableviewIndex());
        }

        private void BtnGaodeMap_OnClicked(object sender, EventArgs e)
        {
            Navigation.PushAsync(new GaodeMapTest());
        }
    }
}
